package com.ruoyi.rocky.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.rocky.enums.OrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 订单对象 pc_order
 * @date 2024-04-26
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("pc_order")
@ApiModel(value = "PcOrder", description = "订单表")
@AllArgsConstructor
public class PcOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @ApiModelProperty(value = "订单id")
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 店铺名称
     */
    @ApiModelProperty(value = "店铺名称")
    @TableField(value = "store_name")
    private String storeName;

    /**
     * 车牌号
     */
    @ApiModelProperty(value = "车牌号")
    @TableField(value = "license_plate")
    private String licensePlate;

    /**
     * 产品名称
     */
    @ApiModelProperty(value = "产品名称")
    @TableField(value = "product_name")
    private String productName;

    /**
     * 城市
     */
    @ApiModelProperty(value = "城市")
    @TableField(value = "city")
    private String city;

    /**
     * 订单状态
     */
    @ApiModelProperty(value = "订单状态  daiZhiFu=待支付 daiFa=待发货 peiSong=配送中 wanCheng=已完成 quXiao=取消订单")
    @TableField(value = "status")
    private Integer status;

    private Integer statusX;

    public String getStatusX() {
        if (this.status == null){
            return null;
        }else{
            return OrderStatus.findByCode(this.status).getDesc();
        }
    }

    /**
     * 快递单号
     */
    @ApiModelProperty(value = "快递单号")
    @TableField(value = "tracking_number")
    private String trackingNumber;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(value = "create_user")
    private Long createUser;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @TableField(value = "update_user")
    private Long updateUser;


}

